package com.wwt.blog.controller;

import com.wwt.blog.service.RegisterService;
import com.wwt.blog.vo.Result;
import com.wwt.blog.vo.param.LoginParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Transactional //开启事务
//注冊控制器
public class RegisterController {
    @Autowired
    RegisterService registerService;

    @PostMapping("/register")
    public Result userRegister(@RequestBody LoginParam loginParam) {
        return registerService.register(loginParam);
    }
}